﻿using MiniExcelLibs.Attributes;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AttendanceSysytem.Models
{
    [SugarTable("Employees")]
    public class Employees
    {
        [SugarColumn(ColumnName = "Id", IsIdentity = true, IsPrimaryKey = true)]
        public int Id { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        [SugarColumn(ColumnName = "Name")]
        public string Name { get; set; }
        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnName = "Account")]
        public string Account {  get; set; }

        /// <summary>
        /// 职务名称
        /// </summary>
        [SugarColumn(ColumnName = "JobName")]
        public string JobName {  get; set; } = string.Empty;
        /// <summary>
        /// 手机号码
        /// </summary>
        [SugarColumn(ColumnName = "Phone")]
        public string Phone {  get; set; } = string.Empty;
        [SugarColumn(ColumnName = "DepartText")]
        public string DepartText {  get; set; } = string.Empty;
        [SugarColumn(ColumnName = "Sex")]
        public string Sex { get; set; } = "男";
        /// <summary>
        /// 考勤规则 1办公室员工 2车间员工
        /// </summary>
        [SugarColumn(ColumnName = "TimeRule")]
        public int TimeRule { get; set; } = 1;

        [SugarColumn(IsIgnore =true)]
        public string TimeRuleText
        {
            get {
                if (TimeRule == 1)
                    return "办公室";
                else
                    return "车间";
            }
        }

    }

    public class ImportEmployeeTable
    {
        [ExcelColumnIndex("A")]
        public string Name { get; set; }
        /// <summary>
        /// 账号
        /// </summary>
        [ExcelColumnIndex("B")]
        public string Account { get; set; }

        /// <summary>
        /// 职务名称
        /// </summary>
        [ExcelColumnIndex("D")]
        public string JobName { get; set; }
        /// <summary>
        /// 手机号码
        /// </summary>
        [ExcelColumnIndex("G")]
        public string Phone { get; set; }
        [ExcelColumnIndex("E")]
        public string DepartText { get; set; }
        [ExcelColumnIndex("F")]
        public string Sex { get; set; }
    }



}
